<?php

namespace App\Models\Common;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class City extends Model
{
    use SoftDeletes;

    protected $table = 'citys';

    public function areas() : HasMany
    {
        return $this->hasMany(Area::class, 'code_c', 'code_c');
    }

    public function province()
    {
        return $this->belongsTo(Province::class, 'code_p', 'code_p');
    }
}
